/*
 * Copyright (c) 2025 EasyAdmin
 * All rights reserved.
 *
 * This file is part of the [EasAdmin] project.
 * Unauthorized copying of this file, via any medium, is strictly prohibited.
 * Proprietary and confidential.
 *
 * Author: EasyAdmin ( 1073602@qq.com )
 * Website: https://www.xhxiao.com
 */
package com.easy.module.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.easy.framework.common.validate.Add;
import com.easy.framework.common.validate.Update;
import com.easy.framework.database.entity.DefaultEntity;
import com.easy.framework.poi.annotation.Excel;
import com.easy.framework.poi.annotation.Option;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

/**
 * 模板信息 实体
 *
 * @author EasyAdmin ( 1073602@qq.com )
 * @date 2025-08-17 16:24:54
 */
@Getter
@Setter
@TableName("sys_template")
public class SysTemplate extends DefaultEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 编号
     */
    @Excel(name = "编号")
    @NotNull(message = "模板编码不能为空", groups = {Update.class})
    @TableId(type = IdType.AUTO)
    private Long id;


    /**
     * 模板编码
     */
    @Excel(name = "模板编码")
    @NotBlank(message="模板编码不能为空", groups = {Add.class,Update.class})
    @Size(message = "模板编码长度必须小于32个字符", max = 32, groups = {Add.class, Update.class})

    private String code;


    /**
     * 模板名称
     */
    @Excel(name = "模板名称")
    @NotBlank(message="模板名称不能为空", groups = {Add.class,Update.class})
    @Size(message = "模板名称长度必须小于255个字符", max = 255, groups = {Add.class, Update.class})

    private String name;


    /**
     * 模板内容
     */
    @Excel(name = "模板内容")
    @NotBlank(message="模板内容不能为空", groups = {Add.class,Update.class})


    private String content;


    /**
     * 模板类型
     */
    @Excel(name = "模板类型")
    @NotNull(message="模板类型不能为空", groups = {Add.class,Update.class})


    private Integer type;


    /**
     * 级别
     */
    @Excel(name = "级别")
    @NotNull(message="级别不能为空", groups = {Add.class,Update.class})


    private Integer level;


    /**
     * 路由地址
     */
    @Excel(name = "路由地址")
    @Size(message = "路由地址长度必须小于255个字符", max = 255, groups = {Add.class, Update.class})

    private String routeUrl;


    /**
     * 状态（0正常 1停用）
     */
    @Excel(
            name = "状态",
            options = {
                    @Option(value = "0", name = "正常"),
                    @Option(value = "1", name = "停用")
            }
    )
    @NotNull(message="状态不能为空", groups = {Add.class,Update.class})
    private Integer status;


    /**
     * 备注
     */
    @Excel(name = "备注")
    @Size(message = "备注长度必须小于500个字符", max = 500, groups = {Add.class, Update.class})

    private String remark;

}